InsetRect
void InsetRect( theRect, distHoriz, distVert ); Rect *theRect ; address of 8-byte Rect structure short distHoriz ; amount to inset (>0) or expand (<0) width
short distVert ; amount to inset or expand height
InsetRect expands or shrinks a rectangle by adjusting the horizontal and vertical coordinates by the specified distance.
theRect is the address of an 8-byte Rect structure. Upon return, its four fields have been modified by the amounts specified by distHoriz and
distVert .
distHoriz specifies the desired horizontal shrinkage or expansion. Positive
values shrink the rectangle toward its center; negative values expand
away from its center.
distVert specifies the desired vertical shrinkage or expansion. Positive
values shrink the rectangle toward its center; negative values expand
away from its center.
Notes: InsetRect provides a simple way to adjust the coordinates of a rectangle to expand or shrink it uniformly in all directions, toward or away from its
center. If, after the call, the height or width of the resulting rectangle is
less than 0, then theRect is set to the empty rectangle (0,0)(0,0).
This call changes the rectangle's width by (2*distHoriz ) and changes its
height by (2*distVert ). It is functionally equivalent to:
theRect.left -= distHoriz;
theRect.top -= distVert;
theRect.right -= distHoriz;
theRect.bottom -= distVert;
if ( EmptyRect( & theRect) ) /* if width or height < 0 */ SetRect( & theRect, 0,0,0,0 );
As with OffsetRect, this has no effect on the screen.